﻿using CloudStorageLight.Core;
using CloudStorageLight.Core.Web;
using CloudStorageLight.SharePointWeb.Models;
using Microsoft.AspNet.Identity.Owin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Threading.Tasks;

namespace CloudStorageLight.SharePointWeb.Controllers
{
    public class WorkTaskController : WorkTaskControllerBase
    {
        protected override BlobService CreateBlobService()
        {
            return new BlobService();
        }



        protected override BlobUser GetCurrentUser()
        {
            if (_user == null)
            {
                _user = BasicAuthenticateUtil.GetCurrentUser();
            }
            return _user;
        }
        private BlobUser _user;


        [SharePointContextFilter]
        public override Task<ActionResult> FileTransfer(string id, string mailAddress, string password, int? fileNo)
        {
            return base.FileTransfer(id, mailAddress, password, fileNo);
        }

        [SharePointContextFilter]
        public override Task<ActionResult> DownloadAsZip(string id, FormCollection fc)
        {
            return base.DownloadAsZip(id, fc);
        }

    }
}